package com.aiti.lulian.workflow;

import lombok.Data;

import java.util.List;


public enum ProcessStatus {
    SUBMITTED,  //已提交待审批
    RUNNING,    // 运行中
    COMPLETED,  // 已完成
    TERMINATED, // 已终止
    SUSPENDED,// 已挂起
    REJECTED;//已驳回

    // 判断流程是否已结束
    public boolean isFinal() {
        return this == COMPLETED || this == REJECTED || this == TERMINATED;
    }


    public String getText() {
        switch (this) {
            case SUBMITTED: return "待审批";
            case RUNNING: return "审批中";
            case COMPLETED: return "已完成";
            case REJECTED: return "已驳回";
            case TERMINATED: return "已终止";
            case SUSPENDED: return "已挂起";
            default: return "未知";
        }
    }

}
